package common.simulation.scenarios;

import common.simulation.scenarios.Operations;
import se.sics.kompics.p2p.experiment.dsl.SimulationScenario;

@SuppressWarnings("serial")
public class ScenarioTask1 extends Scenario {
	private static SimulationScenario scenario = new SimulationScenario() {{
		StochasticProcess process1 = new StochasticProcess() {{
			eventInterArrivalTime(constant(100));
			raise(1, Operations.peerJoin(100), uniform(13));
		}};
		
		StochasticProcess process2 = new StochasticProcess() {{
			eventInterArrivalTime(constant(100));
			raise(12, Operations.peerJoin(200), uniform(13));
		}};

                StochasticProcess process3 = new StochasticProcess() {{
			eventInterArrivalTime(constant(100));
			raise(30, Operations.peerJoin(500), uniform(13));
		}};
                
                StochasticProcess process4 = new StochasticProcess() {{
			eventInterArrivalTime(constant(100));
			raise(9, Operations.peerJoin(1000), uniform(13));
		}};
                
                StochasticProcess process5 = new StochasticProcess() {{
			eventInterArrivalTime(constant(100));
			raise(8, Operations.peerJoin(2000), uniform(13));
		}};
                
                StochasticProcess process6 = new StochasticProcess() {{
			eventInterArrivalTime(constant(100));
			raise(40, Operations.peerJoin(350), uniform(13));
		}};
                
		process1.start();
		process2.startAfterTerminationOf(2000, process1);
                process3.startAfterTerminationOf(2000, process2);
                process4.startAfterTerminationOf(2000, process3);
                process5.startAfterTerminationOf(2000, process4);
                process6.startAfterTerminationOf(2000, process5);
	}};
	
//-------------------------------------------------------------------
	public ScenarioTask1() {
		super(scenario);
	} 
}
